﻿#pragma once
// Inner Fire 游戏引擎库
// 场景类
//
// Copyright (c) 2023 by 尔西大帝. All rights reserved.
//
// 这个类用于控制不同场景。
//
// Author: 尔西大帝
// Email: 2670613871@qq.com
// Created: 2024-11-25

#include <dx_graphics.h>

namespace ifire {

enum class DxSceneID {
  ROOM,
  WATER,
  VEC_ADD,
  TESS_BASIC,
  TESS_PATCH,
  ALTAR,
  INSTANED,
  PICK,
  CUBE,
  DYNAMIC_CUBE,
  NORMAL,
  SHADOWS,
  SSAO,
  SKIN
};

class DxScene {
public:
  DxScene(DxSceneID id) : id_(id), graphics_(nullptr) {}
  ~DxScene() = default;

  void SetGraphics(DxGraphics* graphics) { graphics_ = graphics; }

  void Update();
  void InitPipeline();
  void Draw();
  bool IsTakeoverDraw() const;
  bool IsTakeoverRtvAndDsv() const;
  void DoComputeWork();
  DxSceneID ID() const { return id_; }
  void OnKeyboardInput();
  void OnMouseMove(WPARAM state, int x, int y);
  void OnMouseDown(WPARAM state, int x, int y);
  void OnMouseUp(WPARAM state, int x, int y);
  void CreateRtvAndDsvDescriptorHeaps();

protected:
  DxGraphics* graphics_;
  DxSceneID id_;
};

} // namespace ifire